package day9;

public class t3 {
    public static void main(String[] args) {
        int []arr={1,2,3};
        String creat=arrCreat(arr);
        System.out.println(creat);
    }

    public static String arrCreat(int [] arr) {
        if(arr==null) return "";
        if(arr.length==0) return "[]";
        String creat ="[";
        for (int i = 0; i < arr.length; i++) {
            if(i==arr.length-1){
                creat=creat+arr[i]+"]";
            }
            else{
                creat=creat+arr[i]+",";
            }
        }
        return creat;
    }
}
